#menu_right(user.token)
#for(r:menus)
#modeltag({tagcode:"jxbrms_systemmenu",id:r.menu_id,name:"menu"})
#if(menu.i_level == 1)
  #if (cycFlag == 3)
  </ul>
  </li>
  </ul>
  #else if(cycFlag == 2)
  </ul>
  #end
  #set(cycFlag = 1)
  #if (for.index >0)
  </li>
  #end
<li>

    <a href="#">
        <i class='#(menu.image ?? "fa fa-home")'></i>
        <span class="nav-label">#(menu.menuname)</span>
        <span class="fa arrow"></span>
    </a>
#else if (menu.i_level == 2)
  #if (cycFlag == 3)
  </ul>
  </li>
  </ul>
  #else if(cycFlag == 2)
  </ul>
  #end
  
  #if(menu.ChildMenuCount == 0 )
  #set(cycFlag = 2)
      <ul class="nav nav-second-level">
          <li>
              <a class="J_menuItem" href="#(menu.menulink)" data-index="0">#(menu.menuname)</a>
          </li>
  #else
    #set(cycFlag = 3)
    <ul class="nav nav-second-level">
    <li>
        <a href="#">#if(menu.image ??)<i class='#(menu.image)'></i>#end#(menu.menuname)<span class="fa arrow"></span></a>
        <ul class="nav nav-third-level">
  #end
#else
          <li>
              #if((menu.menulink ?? '') == "")
          <a class="J_menuItem" href="#(menu.menulink)">#(menu.menuname)</a>
          #elseif((menu.menulink ??).contains("tree"))
          <a class="J_menuItem" href="#(menu.menulink)">#(menu.menuname)</a>
          #else
          <a class="J_menuItem" href="#(menu.menulink)">#(menu.menuname)</a>
          #end
          </li>
#end
#end
  #if (cycFlag == 3)
  </ul>
  </li>
  </ul>
  #else if(cycFlag == 2)
  </ul>
  #end
</li>